package com.kyh.enume.sys;

public class ColEnum {
	// 字段类型
	public enum ColType {
		TEXT("文本框", 1), SELECTOR("选择框", 2), HYPE_TEXT("富文本", 3), IMG("图片", 4),
		DATE_YYMMDD_HH_mm_ss("日期", 5), DATE_YYMMDD_00_00_00("日期", 6), DATE_YYMMDD_23_59_59("日期", 7),
		SELECTOR_MODAL("选择框（弹出型）", 8),
		TEXTAREA("文本框（大）", 9),
		BOOLEAN("布尔框", 10),
		FILE("文件", 11);
		public String name;
		public Integer value;

		private ColType(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (ColType e : ColType.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 是否显示
	public enum StatusShow {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusShow(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusShow e : StatusShow.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 新增
	public enum StatusAdd {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusAdd(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusAdd e : StatusAdd.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 是否编辑
	public enum StatusEdit {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusEdit(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusEdit e : StatusEdit.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 是否显示序号
	public enum StatusIsShowNo {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusIsShowNo(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusIsShowNo e : StatusIsShowNo.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 是否验证
	public enum StatusValidate {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusValidate(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusValidate e : StatusValidate.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 是否搜索
	public enum StatusSearch {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusSearch(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusSearch e : StatusSearch.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
	
	// 列表是否可编辑
	public enum StatusListEdit {
		NO("否", 0), YES("是", 1);
		public String name;
		public Integer value;

		private StatusListEdit(String name, Integer value) {
			this.name = name;
			this.value = value;
		}

		public static String getName(int value) {
			for (StatusListEdit e : StatusListEdit.values()) {
				if (e.value == value) {
					return e.name;
				}
			}

			return "";
		}
	}
}
